package com.ssy.lingxi.platform.template.service.repository;

import com.ssy.lingxi.platform.template.service.entity.door.MemberChannel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MemberChannelRepository extends JpaRepository<MemberChannel, Long> {

    boolean existsByInviteCode(String inviteCode);

    MemberChannel findByMemberId(Long memberId);

    MemberChannel findByMemberIdAndRoleId(Long memberId, Long roleId);

    List<MemberChannel> findAllByMemberIdIn(List<Long> memberIds);

    boolean existsByMemberIdAndRoleId(Long memberId, Long roleId);

    List<MemberChannel> findByRoleId(Long roleId);

    MemberChannel findByInviteCode(String inviteCode);

    List<MemberChannel> findByMemberIdIn(List<Long> memberIds);
}
